home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / sepia.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  3KB  |  125 lines

  1. /* Sepia.rexx V2.0 -- Make a pic or clip sepiatone.             */
  2. /* By Bob Caron © 1995 NewTek Inc.                              */
  3. /* Originaly by Arnie Cachelin                                  */
  4.  
  5. parse arg InClipName","OutClipName","StartField","EndField
  6.  
  7. Address "DigiPaint"
  8. options results
  9.  
  10.  
  11. screen=0
  12. if inclipname="" & outclipname="" then screen=1
  13. if screen=1 then do
  14.    startfield=1
  15.    endfield=1
  16.    outclipname="Test"
  17.    end
  18.  
  19. IFFBaseName=OutClipName
  20.  
  21. if ~show('l','rexxsupport.library') then do
  22.   if ~addlib('rexxsupport.library',0,-30,34) then do
  23.     exit
  24.   end
  25. end
  26.  
  27. /* Reset Paint */
  28. 'Pmcl'
  29. 'Pot0' 0
  30. 'Pot1' 0
  31. 'Poth' $8000
  32. 'Potv' $8000
  33. 'Spoh' $8000
  34. 'Spov'
  35. /* End Of Reset*/
  36.  
  37. PageWide=752
  38. PageHigh=480
  39. dots=0
  40. XWin = 100
  41. YWin = 40
  42. Clear = d2c(12)
  43. nv = ''
  44. cr = '0a'x
  45. call getfontsize
  46.  
  47. wid = width*48
  48. hei = theight+height*10
  49.  
  50. if screen=0 then do
  51.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/SepiaTone Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  52.        exit
  53.    end
  54. end
  55.  
  56. do Frame = StartField to (StartField+(EndField-StartField)/2)
  57.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  58.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  59.   call filter()                    /* Do The filter Thing...                 */
  60.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  61.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  62.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  63.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  64.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  65.   end
  66. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  67. exit
  68.  
  69. filter:  /* Do a filter */
  70.  
  71. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  72. 'Pmco'
  73. 'Cbx7'
  74. 'Pot0' 0
  75. 'Pot1' 0
  76. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  77. 'Whsc'          /* Fill Whole Screen */
  78.  
  79. return
  80.  
  81.  
  82. OpenWindow:
  83. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  84.   pdots="...."
  85.   dots=dots+1
  86.   if dots>4 then dots=1
  87.   call writech('Window',Clear||nv||cr)
  88.   call writech('Window','Current Source Clip ['InClipName']'cr)
  89.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  90.   call writech('Window',''cr)
  91.   call writech('Window','Current Frame: 'Frame/2''cr)
  92.   call writech('Window','    End Frame:'EndFrame/2''cr)
  93.   call writech('Window',''cr)
  94.   call writech('Window','Processing'right(pdots,dots)||cr)
  95.  
  96. return
  97.  
  98.  
  99. getfontsize:
  100.  
  101. if open('font','env:sys/font.prefs','R') then do
  102.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  103.    call close('font')
  104.    font = substr(font,index(font,'FONT')+4)
  105.    font = substr(font,index(font,'FONT')+4)
  106.    height = c2d(substr(font,29,2))
  107.    tfont = substr(font,index(font,'FONT')+4)
  108.    theight = c2d(substr(tfont,29,2))
  109.    font = substr(font,33)
  110.    font = left(font,index(font,d2c(0))-1-5)
  111.    if open('font','FONTS:'font'/'height,'R') then do
  112.       width = c2d(right(readch('font',116),2))
  113.       call close('font')
  114.   end
  115.   else if height=9 then width = 10
  116.                    else width = 8
  117. end
  118.   else do
  119.   theight = 8
  120.   height = 8
  121.   width = 8
  122. end
  123.  
  124. return
  125.